﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeBuilder.Controls
{
    public class ExTabPage : System.Windows.Forms.TabPage
    {
        private ExTextEdidor sharpEditor;

        public ExTabPage()
            : this("tabPage",string.Empty,TextStyleType.cs)
        {
            
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="Code">代码</param>
        /// <param name="StypeType">编辑器类型</param>
        public ExTabPage(string Text,string Code,TextStyleType StypeType)
            : base()
        {
            this.Text = Text;
            this.Code = Code;
            this.StypeType = StypeType;

            InitContols();
        }

        public string Code
        {
            get;
            set;
        }

        /// <summary>
        /// 编辑器类型
        /// </summary>
        public TextStyleType StypeType
        {
            get;
            set;
        }

        private void InitContols()
        {
            sharpEditor = new ExTextEdidor(StypeType, this.Code);
            sharpEditor.Dock = DockStyle.Fill;
            sharpEditor.Name = "sharpEditor";
            sharpEditor.ShowEOLMarkers = false;
            sharpEditor.ShowHRuler = false;
            sharpEditor.ShowSpaces = false;
            sharpEditor.ShowTabs = false;
            sharpEditor.ShowVRuler = false;        
            this.Controls.Add(sharpEditor);
        }

    }
}
